import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const myRouter = new Router({
  routes: [
    { path: '/', component: () => import('@/views/home/index') }, // 首页
    { path: '/choose',
      component: () => import('@/views/type/index'),
      redirect: '/choose?type=all',
      children: [
        {
          path: '/',
          component: () => import('@/views/type/dataList'),
          meta: { keepAlive: true }
        },
        {
          path: 'all',
          component: () => import('@/views/type/dataList'),
          meta: { keepAlive: true }
        }
      ]
    }, // 选择模版
    { path: '/template', component: () => import('@/views/template/index') }, // 预览模版
    //  建党
    { path: '/make/jiandang', component: () => import('@/views/make/jiandang/preview') },
    { path: '/show/jiandang', component: () => import('@/views/make/jiandang/show') },
    // 建军
    { path: '/make/jianjun', component: () => import('@/views/make/jianjun/preview') },
    { path: '/show/jianjun', component: () => import('@/views/make/jianjun/show') },
    // 教师
    { path: '/make/jiaoshi', component: () => import('@/views/make/jiaoshi/preview') },
    { path: '/show/jiaoshi', component: () => import('@/views/make/jiaoshi/show') },
    // 国庆
    { path: '/make/guoqin', component: () => import('@/views/make/guoqin/preview') },
    { path: '/show/guoqin', component: () => import('@/views/make/guoqin/show') },
    // 中秋
    { path: '/make/zhongqiu', component: () => import('@/views/make/zhongqiu/preview') },
    { path: '/show/zhongqiu', component: () => import('@/views/make/zhongqiu/show') },
    // 感恩
    { path: '/make/ganen', component: () => import('@/views/make/ganen/preview') },
    { path: '/show/ganen', component: () => import('@/views/make/ganen/show') },
    // 元旦
    { path: '/make/yuandan', component: () => import('@/views/make/yuandan/preview') },
    { path: '/show/yuandan', component: () => import('@/views/make/yuandan/show') },
    // 父亲
    { path: '/make/fuqin', component: () => import('@/views/make/fuqin/preview') },
    { path: '/show/fuqin', component: () => import('@/views/make/fuqin/show') },
    // 端午
    { path: '/make/duanwu', component: () => import('@/views/make/duanwu/preview') },
    { path: '/show/duanwu', component: () => import('@/views/make/duanwu/show') },
    // 儿童
    { path: '/make/ertong', component: () => import('@/views/make/ertong/preview') },
    { path: '/show/ertong', component: () => import('@/views/make/ertong/show') },
    // 重定向
    { path: '*', redirect: '/' }
  ]
})
export default myRouter
